image1=imread('fig6.tif');
subplot(2,2,1)
imshow(image1)
[m,n]=size(image1);
result1=zeros(m,n);
left=[1/3,0,0;0,1/2,0;0,0,1];
for i=1:m
    for j=1:n
        t=left*[i;j;1];
        if t(1,1)<=m&&t(2,1)<=n&&t(1,1)>=1&&t(2,1)>=1
             result1(round(t(1,1)),round(t(2,1)))=image1(i,j);
        end
    end
end
left1=[2,0,0;0,3,0;0,0,1];
result2=zeros(m,n);
for i=1:m
    for j=1:n
        t=left1*[i;j;1];
        if t(1,1)<=m&&t(2,1)<=n&&t(1,1)>=1&&t(2,1)>=1
            result2(t(1,1),t(2,1))=image1(i,j);
        end
    end
end
subplot(2,2,2)
imshow(uint8(result1));
subplot(2,2,3);
imshow(uint8(result2));